package com.github.thinwonton.spring.web.controller;

import com.github.thinwonton.spring.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

@Controller
@RequestMapping("/api/user")
public class UserInfoController {

    @RequestMapping("/{id}")
    @ResponseBody
    public User loginAjax(@PathVariable String id) {
        System.out.println("获取用户资料");
        return new User(id, "hugo", 18);
    }

    public static void main(String[] args) {
        System.out.println("测试中文");
    }
}
